fix: use Basic auth for git clone/push/fetch - #261
Merged
Conversation
GitHub's git server rejects Authorization: Bearer for HTTPS git operations; Basic auth with x-access-token as the username is the supported scheme for GitHub App installation tokens. Co-Authored-By: Claude Sonnet 4.6
Co-Authored-By: Claude Sonnet 4.6
schilco-rimdev
approved these changes
May 19, 2026
andrewrady
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Authorization: Bearerfor git operations (clone,fetch,push)remote: invalid credentials;token→ falls back to credential prompt; Basic → successGet-GitAuthHeaderhelper that encodesx-access-token:<token>as HTTP Basic, used in all four git call sites (clone, fetch, push tag, delete tag)Format-GitArgsForDisplayto redactAuthorization: Basicin addition to Bearer/tokenRoot cause
PR #259 switched to
Bearerwhich works for REST API calls but not for the git Smart HTTP protocol. The correct scheme for GitHub App installation tokens in git is Basic auth with usernamex-access-token.Test plan
terraform-test-applicationafter SHA bump🤖 Generated with Claude Code